$(function() {

$("#ctimename").blur(
		function() {
			$("#ctimename_msg").empty();
			var name = $(this).val();
			if (name == "" || name == null) {
				$("#ctimename").after("<span id='ctimename_msg' style='color: red'>课时名称不能为空</span>");
			}
	});

$("#sectionx").blur(
		function() {
			$("#sectionx_msg").empty();
			var name = $(this).val();
			if (name == "" || name == null) {
				$("#sectionx").after("<span id='sectionx_msg' style='color: red'>时间段不能为空</span>");
			}
	});

$("#memo").blur(
		function() {
			$("#memo_msg").empty();
			var name = $(this).val();
			if (name == "" || name == null) {
				$("#memo").after("<span id='memo_msg' style='color: red'>备注不能为空</span>");
			}
	});







$('#sub').click(function(){
var ctimename = $("#ctimename").val();
var sectionx = $("#sectionx").val();
var memo = $("#memo").val();
$("#ctimename_msg").empty();
$("#sectionx_msg").empty();
$("#memo_msg").empty();
if (ctimename == "" || ctimename == null) {
	$("#ctimename").after("<span id='ctimename_msg' style='color: red'>课时名称不能为空</span>");
	return false;
}
if (sectionx == "" || sectionx == null) {
	$("#sectionx").after("<span id='sectionx_msg' style='color: red'>时间段不能为空</span>");
	return false;
}
if (memo == "" || memo == null) {
	$("#memo").after("<span id='memo_msg' style='color: red'>备注不能为空</span>");
	return false;
}
});
$('#res').click(function() {
$("#ctimename_msg").empty();
$("#sectionx_msg").empty();
$("#memo_msg").empty();
});

});
